import React, { useState } from "react";
import RegistrationForm from "./registerForm";
import LoginForm from "./loginForm";

import "./index.less";

const Login: React.FC = () => {
  const [isLogin, setIsLogin] = useState<boolean>(true);

  const handleSetIsLogin = (isLogin: boolean) => {
    setIsLogin(isLogin);
  };

  return (
    <div className="login-container">
      {isLogin ? (
        <LoginForm handleSetIsLogin={handleSetIsLogin} />
      ) : (
        <RegistrationForm handleSetIsLogin={handleSetIsLogin} />
      )}
    </div>
  );
};

export default Login;
